<?php
/* 
* [***********************]
* @author: mazhenyu[houdunwangmzy@163.com]
* @Date:   2014-07-09 20:41:49
* @Last Modified time: 2014-07-09 21:22:40
*/
class ApplyModel extends Model{
	public $table = 'apply';

	/**
	 * [check_apply 检测是否有重复投递]
	 * @param  [type] $cpid [description]
	 * @param  [type] $reid [description]
	 * @return [type]       [description]
	 */
	public function check_apply($cpid,$reid){
		if(!$cpid || !$reid) return false;

		$where = array(
			'position_cpid'	=>	$cpid,
			'resume1_reid'	=>	$reid
			);

		return $this->where($where)->getField('position_cpid');
	}

	/**
	 * [add_data 添加数据]
	 * @param [type] $cpid       [description]
	 * @param [type] $reid       [description]
	 * @param [type] $companyUid [description]
	 */
	public function add_data($cpid,$reid,$companyUid){
		$data = array(
			'addtime'		=>	time(),
			'resume1_reid'	=>	$reid,
			'position_cpid'	=>	$cpid,
			'company_uid'	=>	$companyUid,
			'people_uid'	=>	session('uid')
			);

		return $this->add($data);
	}

	
}
?>
